package com.huluobo.a2110mvpimdemo.mine;

import com.huluobo.a2110mvpimdemo.base.BasePresenter;
import com.hyphenate.EMCallBack;
import com.hyphenate.chat.EMClient;

/**
 * Created by LC on 2023/12/12.
 */
public class MinePresenter extends BasePresenter<MineContract.View> implements MineContract.Presenter {
    @Override
    public void logout() {
        getView().onStartLogout();
        EMClient.getInstance().logout(true, new EMCallBack() {
            @Override
            public void onSuccess() {
                if (isAttach()) {
                    getView().onLogoutSuccess();
                }
            }

            @Override
            public void onError(int code, String error) {
                if (isAttach()) {
                    getView().onLogoutFailed(error);
                }
            }
        });
    }
}
